package Test_319_4;

import java.util.Date;

public class SalariedEmployee extends  ColaEmployee{//继承

    double MonthSalary;//月薪


    //自定义构造方法
    public SalariedEmployee(String ColaName , int month , int ColaBirthday ,double MonthSalary ){
        super(ColaName,month,ColaBirthday);//继承父类的属性
        this.MonthSalary = MonthSalary;

        //判断如果员工过生日，则公司会额外奖励100元，否则只拿到月薪
        //拿固定工资的员工
        if (super.getMonth()==super.getColaBirthday()){
            System.out.println("============员工过生日==================");
            System.out.println("员工"+ColaName+month+"月的工资为"+(MonthSalary+100));
        }else {
            System.out.println("============员工不过生日==============================");
            System.out.println("员工"+ColaName+month+"月的工资为"+MonthSalary);
        }

    }

}
